""" 二进制 """
def test_bin():
    a = 0b11
    print("a: ", a)
    print("10转2 进制, bin(7): ", bin(7))
    print("2 转 10 进制, int('0b1101', 2): ", int("0b1101", 2))

""" 8进制 """
def test_oct():
    a = 0o123
    print("a: ", a)
    print("10转8 进制, oct(123): ", oct(123))
    print("8 转 10 进制, int('0o123', 8): ", int('0o123', 8))

""" 16进制 """
def test_hex():
    a = 0x11
    print("a: ", a)
    print("10转16 进制, hex(255): ", hex(255))
    print("16 转 10 进制, int('0xff', 16): ", int('0xff', 16))

test_bin()
test_oct()
test_hex()
# a = 0o123
